<#if !parameters.fieldGroup?exists>
	<#include "/${parameters.templateDir}/${parameters.theme}/controlheader.ftl" />
</#if>
<input type="text"<#rt/>
 name="${parameters.name?default("")?html}"<#rt/>
<#if parameters.get("size")?exists>
 size="${parameters.get("size")?html}"<#rt/>
</#if>
<#if parameters.maxlength?exists>
 maxlength="${parameters.maxlength?html}"<#rt/>
</#if>
<#if parameters.nameValue?exists>
 value="<@s.property value="parameters.nameValue"/>"<#rt/>
</#if>
<#if parameters.disabled?default(false)>
 disabled="disabled"<#rt/>
</#if>
<#if parameters.readonly?default(false)>
 readonly="readonly"<#rt/>
</#if>
<#if parameters.tabindex?exists>
 tabindex="${parameters.tabindex?html}"<#rt/>
</#if>
<#if parameters.id?exists>
 id="${parameters.id?html}"<#rt/>
<#else>
 id="_autocompleter"
</#if>
<#if parameters.cssClass?exists>
 class="${parameters.cssClass?html}"<#rt/>
</#if>
<#if parameters.cssStyle?exists>
 style="${parameters.cssStyle?html}"<#rt/>
</#if>
<#if parameters.title?exists>
 title="${parameters.title?html}"<#rt/>
</#if>
<#if parameters.onclick?exists>
 onclick="${parameters.onclick?html}"<#rt/>
</#if>
<#if parameters.ondblclick?exists>
 ondblclick="${parameters.ondblclick?html}"<#rt/>
</#if>
<#if parameters.onmousedown?exists>
 onmousedown="${parameters.onmousedown?html}"<#rt/>
</#if>
<#if parameters.onmouseup?exists>
 onmouseup="${parameters.onmouseup?html}"<#rt/>
</#if>
<#if parameters.onmouseover?exists>
 onmouseover="${parameters.onmouseover?html}"<#rt/>
</#if>
<#if parameters.onmousemove?exists>
 onmousemove="${parameters.onmousemove?html}"<#rt/>
</#if>
<#if parameters.onmouseout?exists>
 onmouseout="${parameters.onmouseout?html}"<#rt/>
</#if>
<#if parameters.onfocus?exists>
 onfocus="${parameters.onfocus?html}"<#rt/>

</#if>
<#if parameters.onblur?exists>
 onblur="${parameters.onblur?html}"<#rt/>
<#elseif parameters.isStrictData>
 onblur="autocompleter.onblur();"<#rt/>
</#if>

<#if parameters.onkeypress?exists>
 onkeypress="${parameters.onkeypress?html}"<#rt/>
</#if>
<#if parameters.onkeydown?exists>
 onkeydown="${parameters.onkeydown?html}"<#rt/>
<#else>
 onkeydown="autocompleter.onkeydown(event);"<#rt/>
</#if>
<#if parameters.onkeyup?exists>
 onkeyup="${parameters.onkeyup?html}"<#rt/>
</#if>
<#if parameters.onselect?exists>
 onselect="${parameters.onselect?html}"<#rt/>
</#if>

<#if parameters.oninput?exists>
 oninput="${parameters.oninput?html};autocompleter.onchange();"<#rt/>
<#else>
 oninput="autocompleter.onchange();"<#rt/> 
</#if>
<#if parameters.onchange?exists>
 onchange="${parameters.onchange?html}"<#rt/>
</#if>
<#if parameters.onpropertychange?exists>
 onpropertychange="${parameters.onpropertychange?html};autocompleter.onchange(event);"<#rt/>
<#else>
 onpropertychange="autocompleter.onchange(event);"<#rt/>
</#if>
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
 autocomplete="off"
/>
<#if parameters.showDownArrow>
	<span style="height:15px;margin:0px 0px 0px -4px;background-image:url('')"><img style="width:15px;height:15px;margin-bottom:-6px;border-bottom:1px solid #000000;" onclick="autocompleter.onArrowClick();" src="<@s.url value='/struts/geni/images/autocompleter_arrow.png' includeParams='none' encode='false' />"/></span>
</#if>


<#if !parameters.fieldGroup?exists>	
	<#include "/${parameters.templateDir}/${parameters.theme}/controlfooter.ftl" />
</#if>
<script>
	if(autocompleter == undefined){
		var autocompleter = {};
	}
	<#if parameters.list?exists>
		autocompleter.list = [];
		<#list parameters.list as item>
			autocompleter.list.push("${item}");
		</#list>
	</#if>
	autocompleter.inputElement = document.getElementById("${parameters.id?html}");
	autocompleter.listUrl = "${parameters.listUrl?default("")}";
	autocompleter.listKey = "${parameters.listKey}";
	autocompleter.listWidth = ${parameters.listWidth?default("-1")};
	autocompleter.listHeight = ${parameters.listHeight?default("-1")};
	autocompleter.onCommit = ${parameters.onCommit?default("null")};
	
	autocompleter.listColumns = [];
	autocompleter.groupingColumns = [];
	autocompleter.autoFillColumns = [];
	
	<#if parameters.listColumns?exists>
		<#list parameters.listColumns as column>
			autocompleter.listColumns.push("${column}");
		</#list>
	</#if>
	<#if parameters.groupingColumns?exists>
		<#list parameters.groupingColumns as column>
			autocompleter.groupingColumns.push("${column}");
		</#list>
	</#if>
	<#if parameters.autoFillColumns?exists>
		<#list parameters.autoFillColumns as column>
			autocompleter.autoFillColumns.push("${column}");
		</#list>
	</#if>
	autocompleter.messageNoData = "${parameters.__i18n__.getText("message.autocompleterNoData")}";
	
</script>
